home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / GMSMTH01.ZIP / GAMESMTH.DOC < prev    next >
Encoding:
Text File  |  1996-02-29  |  40.1 KB  |  1,295 lines

  1. This is the docs you get with the FREEWARE version of
  2. GAMESMITH.
  3.  
  4. LEGAL STUFF - read and understand! ---------------------------------
  5.  
  6. GAMESMITH is copyright 1995 by Alexander J. Russell, and Bruce S. Miller
  7. All rights reserved.
  8.  
  9. You are allowed to use Gamesmith to create EXE files, and related
  10. data files (art, sprites, palettes etc...) which can then be
  11. distributed royalty free.
  12.  
  13. NO part of the Gamesmith library, utilities, include files, object
  14. files, and source files may be distributed in any form, EXCEPT for
  15. the original ZIP file containing the full freeware version with NO
  16. modifications which may be distributed!
  17.  
  18. Gamesmith is completely unwarranted, and is used at your own risk.
  19.  
  20. ---------------------------------------------------------------------
  21.  
  22. To recieve full source code write to:
  23.  
  24. alexad3@icebox.iceonline.com
  25.  
  26. Cost for the source code is $100.00 CDN
  27.  
  28. -------------------------------------------------------
  29.  
  30. Gamesmith is a library of ASM and Borland C compatible modules in the 
  31. MEDIUM memory model, DOS real mode. 
  32.  
  33. Gamesmith includes powerful utilities to be used by programmers to 
  34. quickly create a wide variety of games. Gamesmith is based on the XLIB 
  35. xmode libraries.
  36.  
  37. A copy of DPAINT II (trademark of EA) is also very useful!
  38.  
  39. Who is GameSmith for?
  40.  
  41. You know C and want to make real cool games. You know about
  42. near and far pointers. You are comfortable with pointers and structs.
  43. You know how to use LIBS, and how to LINK C programs.
  44. You don't need to know any assembler.
  45.  
  46.  
  47. If you get the source you'll want to know assembler.
  48. -----------------------------------------------------------
  49. Overview
  50.  
  51.  
  52. gui editor
  53.         full featured gui with easy to use editor
  54.  
  55. animation engine        
  56.         full featured animation engine with scaling
  57.  
  58. tile-map engine
  59.         full featured scrolling tile-map engine
  60.         can be used in conjuction with the animation engine
  61.  
  62. Debugging tools
  63.         display debug info to an MDA monitor
  64.         track memory use
  65.         check for memory overwrites on all gmalloc'ed mem
  66.         hot keys to:
  67.                 pause
  68.                 display mem in use
  69.                 display registered die functions
  70.  
  71. various utilites
  72.         see below
  73.  
  74. XMS access      
  75.         easy access via functions as easy to use as fopen() etc...
  76.  
  77. primitive, but fast 3d polygon support
  78.         no editor yet, nifty, but still hard to use
  79.  
  80. ------------------------------------------------------------------
  81.  
  82. The borland directory contains example config files.
  83.  
  84. ------------------------------------------------------------------
  85. Utilities
  86.  
  87. This set of utilities is the heart of GAMESMITH. They do everything
  88. you need to do right now! Most utils will display help info if run
  89. with no parms.
  90.  
  91. EDITGUI  EXE    Powerful editor to draw gui panels, see below for
  92.                   details.
  93. GUI_TEST EXE    Test your new gui panels - works wih any file created
  94.                   by EDITGUI.exe
  95. EDITMAP  EXE    Visual tile map editor
  96. EDITSPR  EXE    Visual animation engine editor
  97. LISTIFF  EXE    List info for dpaint LBM files
  98. MAKE13   EXE    Turn dpaint LBM/BBM files into m13 bitmaps (linear)
  99. MAKECBM  EXE    Turn dpaint LBM/BBM files into cbm bitmaps (compiled)
  100. MAKELIB  EXE    Glue data files together into a library. 
  101. MAKEPAL  EXE    Extract palette info from LBM,BBM, and PCX files.
  102. MAKEPBM  EXE    Turn dpaint LBM/BBM files into pbm bitmaps (planed)
  103. MKANM    EXE    Create an anim (like a FLI file) from a series of
  104.                   LBM's. A mode 13 util.
  105. PLAYANM  EXE    Play anm files (mode 13 only)
  106. READBBM  EXE    Display LBM and BBM files
  107. SHOW13   EXE    Display m13 files
  108. SHOWCBM  EXE    Display cbm files
  109. SHOWPBM  EXE    Display pbm files
  110. BITMAPB  GUI    Used by EDITGUI.EXE - a gui panel created with
  111.                   EDITGUI.exe.
  112. COLOR    GUI    Used by EDITGUI.EXE
  113. SPC      EXE    Compile demo script files.
  114. INPUT    GUI    Used by EDITGUI.EXE
  115. RECT     GUI    Used by EDITGUI.EXE
  116. SLIDER   GUI    Used by EDITGUI.EXE
  117. TEXT     GUI    Used by EDITGUI.EXE
  118. TEXTB    GUI    Used by EDITGUI.EXE
  119. MAKEPKB  EXE    Turn dpaint LBM/BBM files into PKB bitmaps (planed RLE)
  120. SHOWPKB  EXE    Display PKB files
  121. CRSHAIR  CBM    Default mouse cursor for many utilities
  122. STD      PAL    Default palette
  123. HAPPY    PBM    Default bitmap for new buttons
  124. USER5    FNT    Screen font
  125. GLUEHORZ EXE    Glue 2 m13 bitmaps together side to side (must be
  126.                   same height). Used to get around limitations of Dpaint.
  127. M13_2_PB EXE    Convert m13 bitmaps to pbm bitmaps
  128. PLIST    GUI    Used by GUI_EXIT.EXE
  129. RADIO    GUI    Used by GUI_EXIT.EXE
  130. USER2    FNT    Screen font
  131. USER3    FNT    Screen font
  132. USER4    FNT    Screen font
  133. TABORD   GUI    Used by EDITGUI.EXE
  134. CPUID    EXE    Identifiy the CPU, sets dos errorlevel for CPU type for
  135.                   use in batch files.
  136. PARMS    GUI    Used by EDITGUI.EXE
  137. DSRPCSHW EXE    Display demo scripts compiled with spc.exe
  138. MAKESPR  EXE    Make sprite file - see animation engine docs
  139. CHNGEPAL EXE    Change a LBM or BBM's internal palette
  140. PCX2PBM  EXE    Convert PCX file to pbm
  141. PCX2CBM  EXE    Convert PCX file to cbm
  142. SIZEMOUS CBM    Used by EDITGUI.
  143.  
  144.  
  145. It makes life a lot easier if you add your util directory to your
  146. path!
  147.  
  148. Details of selected utilities --------------------------------
  149.  
  150. EDITGUI.EXE
  151.  
  152. Create GUI panels, interface elements, quickly and easily!
  153. Just draw them on the screen.
  154.  
  155. All gui panels have a main rectangle that all the gadgets are placed
  156. on. This main retangle can be invisible if you want the gadgets to
  157. float ontop of a nice background. Each gadget has a UNIQUE id number.
  158. It is possible to change the ID's, and you must be careful to make
  159. sure that they are UNIQUE within each panel!
  160.  
  161. Gadgets that can be used:
  162.  
  163. Text            Text of any color, in a number of fonts.
  164. Text input      Editable text in a input box.
  165.                 Support insert/overwrite, del, backspace, delete
  166.                 from cursor to end of line (CTRL-Y), home, end, left
  167.                 and right. Text can be numbers only, and password
  168.                 (all text is displayed as '*') as well as plain text.
  169. Text button     Rectangular push button with hot key
  170. Bitmap button   Rectangular button with bitmap displayed instead of
  171.                 text, also has hotkey. All buttons allow user to
  172.                 change mind by moving mouse off the button before releasing 
  173.                 mouse button.
  174. Radio-buttons   horizontal or vertaical collection of
  175.                 mutually-exclusive buttons.
  176. Sliders         Vertical or horizontal sliders. Thumb can be dragged,
  177.                 or clicking above/below thumb moves one page.
  178. Pick-list       Scroll box with slider for making a single selection
  179.                 from a list, or tagging mutliple selections from a
  180.                 list. Use arrow keys, home, end,page up/down or
  181.                 slider to move through list.
  182.  
  183.  
  184. Using the GUI editor.
  185.  
  186. EDITGUI gui_filename [set_file_name]<ENTER>
  187.  
  188. gui_file_name is an existing or new gui file. If new, a default panel
  189. is created with a title and two text buttons. set_file_name can be
  190. used to restore colour and palette preferences that were saved
  191. previously. If set_file_name isn't specified the default palette and
  192. colours are used.
  193.  
  194. Moving gadgets - click on the gadget with left mouse button in the centre
  195. of the gadget, and drag with the left mouse button down.
  196.  
  197. Sizing gadgets - click on the gadget's border (mouse cursor changes to
  198. a two-head pointer when on a border) and move mouse with left button
  199. down to size.
  200.  
  201. Editing gadget parameters - click on a gadget with the right mouse
  202. button to display the main edit screen. The first screen is the same
  203. for all gadgets. Click on MORE to set gadget specfic parameters.
  204. Changing the GRID value to a non-zero number turns on the GRID
  205. function.
  206.  
  207. Grid - when turned on all moving and sizing operations are limited to
  208. increments as defined by the grid value.
  209.  
  210. ALT-C - centres text in text buttons, and text patches.
  211.  
  212. F1 - displays a help screen
  213.  
  214. F9 - save current gui
  215. F10 - save then exit.
  216. ESC - exit without saving.
  217.  
  218.  
  219. Test the look and feel of gui panels with GUI_TEST.EXE
  220. gui_test gui_file_name<ENTER>
  221. gui_text.exe always uses the std.pal located in the same directory as
  222. gui_test.exe.
  223.  
  224. ID's!!!!
  225.  
  226. Gadget ID's are very important. When a user clicks on a gadget it is
  227. the ID that is returned to your program. In large programs with many
  228. gui panels it is important to plan the use of id's. By default the
  229. editor gives each gadget a unique ID, but only unique for that file.
  230. It is a good idea to give each panel a set of numbers: say panel one uses
  231. 1 to 99, panel two 100 to 199, panel three 200 to 299 etc...
  232.  
  233. Gui panels are completely re-drawn each frame. Why? So you can easily
  234. do special effects over or under them without worrying about updates.
  235.  
  236.  
  237. To use many gui panels without going to disk use:
  238.  
  239. void gui_push(void);  // save the currently displayed gui panel in a
  240.                       // stack, then you can load another
  241. void gui_stack_select(short num);
  242.                      // select any pushed panel, the 1st panel pushed
  243.                      // is num=0, the second is num=1 etc...
  244.  
  245.  
  246. void gui_pop(void); // remove the TOP most gui_panel from the stack
  247.                     // generally you gui_unload_gadget() first.
  248.  
  249. void gui_pop_all(void); // pop_em all - also unloads them
  250.  
  251.  
  252. See below for example source.
  253.  
  254. See g_io.h and gui.h also.
  255.  
  256. GUI and other I/O ---------------------------------------
  257. EVENT types, and related data
  258.  
  259.    event.x and event.y are the current mouse position unless
  260.    otherwise noted.
  261.  
  262.    event.type
  263.  
  264.    E_MOUSE_MOVE
  265.    E_R_BUTTON_DN
  266.    E_R_BUTTON_UP
  267.    E_L_BUTTON_DN
  268.    E_L_BUTTON_UP
  269.  
  270.    E_JOY_X_LEFT
  271.    E_JOY_X_CENTRE
  272.    E_JOY_X_RIGHT
  273.    E_JOY_Y_UP
  274.    E_JOY_Y_CENTRE
  275.    E_JOY_Y_DOWN
  276.         event.x, event.y - raw x,y for joystick
  277.  
  278.    E_B0_UP
  279.    E_B0_DN
  280.    E_B1_UP
  281.    E_B1_DN
  282.         event.x, event.y - undefined
  283.  
  284.    E_KEY
  285.         event.sub_type
  286.         E_UP
  287.         E_DOWN
  288.  
  289.         event.d1   raw scan code
  290.         event.d2   ascii code, NOTE! uses non-ascii for ALT keys
  291.  
  292.    E_GUI
  293.         event.d1=gadget id
  294.  
  295.         event.d2 is for each gadget:
  296.  
  297.         button       - undefined
  298.         text         - undefined
  299.         input        - undefined
  300.         radio button - active button number from set (0...max-1)
  301.         pick-list    - plist.cursor_item, item cursor is on now
  302.         slider       - value of slider.th_top, position of thumb   
  303.  
  304.  
  305.  
  306.         NOTE!
  307.         The global array key_stat[] contains 1's for down keys, and
  308.         0's for up keys. Indexed by RAW scan code.
  309.  
  310. ----------------------------------------------------------------------
  311.  
  312. STEPS TO CREATE AND USE A SPRITE ANIMATION SEQUENCE:
  313. ----------------------------------------------------
  314. Use the following steps to create, visually fine-tune, and use
  315. a sprite sequence of internal animation for your programs.
  316.  
  317. NOTE: You can replace any or all sprites in a compiled, working
  318.       .exe application by simply replacing or modifying the
  319.       sprite files.  You can also fine-tune your animation at any
  320.       time by using "EditSpr.EXE" to visually edit your sprite
  321.       animation files. No re-compiling of your application is
  322.       necessary.
  323.  
  324. 1. Draw a sequence of bitmaps for your animated sprite character
  325.    and save as a series of .PCX, .LBM  or .BBM bitmap files.
  326.    The names for your bitmaps should allow directory sorting
  327.    in the correct order for your internal animation sequencing.
  328.  
  329.    EX:  filenames for a rotating tank:
  330.         tank001.PCX, tank002.PCX, tank003.PCX...
  331.  
  332. 2. Convert the artwork files to the desired type of animation
  333.    bitmap file.  Choose from the following:
  334.  
  335.     .PBM  -   Planar BitMap file.  This is used for general
  336.               purpose planar animation, and allows for clipping.
  337.               Medium speed for medium size shapes.
  338.  
  339.     .PKB  -   PacKed Bitmap file.  This is used for fast drawing
  340.               of large, irregular shaped objects.  Erases/draws
  341.               within shape borders to avoid drawing entire
  342.               rectangle for large shapes. Cannot be clipped.
  343.               Higher speed for large non-rectangular shapes.
  344.  
  345.     .M13  -   Linear bitmap file.  This is used for scaling
  346.               (with automatic clipping).
  347.               Lower speed, but scalable.
  348.  
  349.     .CBM  -   Compiled BitMap.  This is a compiled bitmap used
  350.               for smaller shapes where high speed is essential.
  351.               Compiled for a particular screen resolution.
  352.               Cannot be clipped.  Large file size.
  353.               Highest speed for small shapes.
  354.              
  355.     Use MakePBM.exe, MakePKB.exe, MakeM13.exe, or MakeCBM.exe.
  356.     Can specifiy wildcards.
  357.  
  358.     Ex: "MakePBM tank*.PCX <CR>"  produces: 
  359.         tank001.PBM, tank002.PBM, tank003.PBM...
  360.  
  361. 3. Combine the animation bitmap files into a sprite animation
  362.    sequence file using MakeSPR.exe.  You can name the sprite
  363.    file anything you wish, but .SPR is recommended.
  364.  
  365.    Ex: "MakeSPR tank*.PBM tank.SPR"  produces:  "tank.SPR".
  366.  
  367.    NOTE: you can also use one of the non-clipping bitmap
  368.          types such as .PKB, and create and specify a
  369.          second matching set of .PBM bitmaps for clipping.
  370.          The sprite animation engine automatically switches
  371.          to the clipping .PBM bitmaps at the edges of your
  372.          specified clip rectangle. 
  373.  
  374.    Ex: "MakeSPR tank*.PKB tank *.PBM tank.SPR"
  375.         produces:  "tank.SPR" with .PKB primary bitmaps, and
  376.                    .PBM clipping bitmaps.
  377.  
  378.    Warning: both sets of bitmaps must contain identical artwork,
  379.             and be in the same order in your directory.
  380.  
  381. 4. Fine-tune your sprite animation file using EditSPR.exe.
  382.    See documentation for the EditSPR.exe utility.
  383.  
  384. 5. Use your sprite file in your program.  See source code in
  385.    SprDemo.C for examples.
  386.  
  387. --------------- WHAT IS A TILE MAP ? ----------------
  388.  
  389. A tile map is a grid of bitmaps which is larger
  390. than the screen which forms the background for
  391. a game or simulation.  The tile map is scrollable
  392. to provide the illusion of "travelling" on the map.
  393.  
  394. MAP ELEMENTS:
  395.  
  396.  Tiles: - Small planar bitmaps which are "tiled"
  397.            together to form the tile map.
  398.          - Tiles can be any height or width but the
  399.            width must be a multiple of 4.
  400.          - All tiles in a map are the same size and
  401.            shape.
  402.          - Each tile has an attribute byte which
  403.            contains bits for collision detection,
  404.            etc.
  405.  
  406.  High and Low Dressings:
  407.          - Dressings are bitmaps which overlay the
  408.            tiles and give additional realism.
  409.          - Dressings stay "anchored" to the map
  410.            as it moves to give the appearance that
  411.            they are part of it.
  412.          - Low and high dressings are identical
  413.            except that low dressings are drawn over
  414.            the tiles but under any moveable game
  415.            elements (such as sprites).
  416.          - High dressings are drawn over sprites
  417.            to temporarily cover them as they move.
  418.            Example: trees which sprites can
  419.            "hide" under.
  420.  
  421.  Anims: - Anims are sprites (internally animated
  422.            bitmaps which are attached to the map
  423.            similarly to dressings.
  424.          - Anims are implemented with the sprite
  425.            structures included with GAMESMITH.
  426.  
  427. ELEMENT ATTRIBUTES:
  428.  
  429.  Each tile, dressing and anim has an "attribute"
  430.  byte associated with it that holds 8 on/off
  431.  settings for each tile.
  432.  
  433.  
  434. STEPS TO CREATE AND USE A TILE MAP:
  435. ----------------------------------
  436. Use the following steps to create, visually fine-tune, and use
  437. a scrolling tile map for your application programs.
  438.  
  439. NOTE: You can replace any tile map elements, or entire
  440.       background tile maps in a compiled, working .exe
  441.       application by simply replacing or modifying the
  442.       tile map files.  You can also fine-tune your tile maps
  443.       at any time by using "EditMap.EXE" to visually edit
  444.       your tile map files. No re-compiling of your
  445.       application is necessary.
  446.  
  447. ELEMENTS:
  448.  
  449. A full-blown scrolling tile map consists of 4 major elements:
  450.  
  451.     1)   A background tile library file
  452.     2)   A library of dressings bitmaps file
  453.     3)   A library of animated dressings (sprites) - Optional
  454.     4)   A map file which ties everything together
  455.  
  456. STEPS:
  457.  
  458. 1.  CREATE THE TILE LIBRARY
  459.  
  460.  a)  Create the artwork file for the background tiles
  461.  
  462.    This artwork file will contain a single copy of each
  463.    of the unique background tiles.
  464.    Draw a series of unique tiles in a rectangular grid  
  465.    and save as a single .PCX file.
  466.  
  467.  b)  Convert the artwork file to a tile library file
  468.  
  469.    Use the "MakeTLib.exe" utiltiy to create a tile library
  470.    file ( an array of bitmaps) from the .PCX graphics file.
  471.    Type "MakeTLib.exe" (with no parameters) for instructions.
  472.  
  473. 2.  CREATE THE "DRESSINGS" LIBRARY
  474.  
  475.   a) Create a ".PBM" bitmap file for each of the
  476.      unique map dressings (see "STEPS TO CREATE AND
  477.      USE A SPRITE ANIMATION SEQUENCE" above).
  478.  
  479.   b) Create the dressings library file. Combine the ".PBM"
  480.      files together using the "MakeLib.exe" utility.
  481.  
  482. 3.  CREATE THE "ANIMS" LIBRARY (OPTIONAL)
  483.  
  484.   a) Create a ".SPR" sprite animation file for each
  485.      of the unique anims (see "STEPS TO CREATE AND
  486.      USE A SPRITE ANIMATION SEQUENCE" above).
  487.  
  488.   b) Create the anims library file. Combine the ".SPR"
  489.      files together using the "MakeLib.exe" utility.
  490.  
  491. 4.  CREATE THE TILE MAP FILE
  492.  
  493.    Tie everything together by creating the .MAP file.
  494.    Use the "MakeMap.exe" utility to create a specific
  495.    size map, and tie in the other component files.
  496.    Type "MakeMap.exe" (with no parameters) for instructions.
  497.  
  498. 5.  VISUALLY EDIT THE MAP
  499.  
  500.    Visually place and set attributes for the various elements
  501.    of the map using the "EditMap.exe" utility.
  502.    See documentation for the EditMap.exe utility for details.
  503.  
  504. 6.  USE THE MAP    
  505.  
  506.    Use your tile map in your program.  See source code in
  507.    MapDemo.C for examples.
  508.  
  509. -------------- HOW TO USE "EDIT_MAP" ----------------
  510.  
  511. WORKING WITH TILES, DRESSINGS OR ANIMS:
  512.  
  513.   Click on one of the pusbuttons marked "Tiles",
  514.   "High", "Low", or "Anim" to select the desired
  515.   mode.
  516.  
  517.   The words "Placing Tiles(\High\Low\Anims)" will
  518.   appear in the status window to display the current
  519.   working mode.
  520.  
  521.  
  522. WORKING WITH TILES:
  523.  
  524.  Selecting tiles:
  525.  
  526.   Tiles are selected from the current tile group
  527.   (or range).
  528.  
  529.   Select the tile that you wish to place on the
  530.   map by:
  531.  
  532.    * clicking on one of tiles visible on the top menu
  533.  
  534.    * pressing the function key specified below the
  535.      tile on the menu
  536.  
  537.   Large Tile Ranges:
  538.   If the current tile group includes more than
  539.   9 tiles, an arrow pusbutton will appear to the
  540.   left or right of the tiles on the menu.
  541.  
  542.   To access the tiles to the left of the visible
  543.   range, click the left arrow pushbutton. Similarly
  544.   for the right button.
  545.  
  546.   Random Tile Selection:
  547.   Click on the "Random" pushbutton to have tiles
  548.   selected randomly from the current group.  The
  549.   words "Random On" will appear in the status window
  550.   on the lower right of the top menu. Click the
  551.   pusbutton again to turn random selection off.
  552.  
  553.  Selecting Tile Groups:
  554.  
  555.   Select a tile group (or range) by clicking on the
  556.   "Next" or "Back" pushbuttons.
  557.  
  558.   Tile groups may be larger than the number of tiles
  559.   that can be displayed across the menu (see Large
  560.   Tile Ranges - above ).
  561.  
  562.  Defining Tile Groups (LIB pushbutton):
  563.  
  564.   Tile groups are set using the tile LIBrary editor.
  565.  
  566.   To set the range (or change the range )for tile
  567.   groups, click on the "Lib" button.
  568.  
  569.   Tiles can also be move around in the tile library
  570.   (see the help screen in the tile library editor).
  571.  
  572.  Placing Tiles On The Map:
  573.  
  574.   To place the selected tile on the map, move the
  575.   mouse pointer to the desired location and click
  576.   the left mouse button.  You can drag the mouse to
  577.   place whole rows or blocks if desired.
  578.  
  579.   Random Tile Selection
  580.   If the random feature is turned on, each time you
  581.   click or drag the mouse, a tile will be randomly
  582.   selected from the current tile group as you click
  583.   or drag the mouse.
  584.  
  585.  Deleting Tiles from the Map:
  586.  
  587.   There is no specific delete function for tiles.
  588.   Simply over-write the discarded tile with a new
  589.   tile.
  590.  
  591.  Viewing / Setting Tile Attributes:
  592.  
  593.   To view tile attributes, click on the "ATTRIB"
  594.   pushbutton. Attributes are displayed in a small
  595.   box at the upper left corner of each tile.
  596.   Each bit in the attibute byte is displayed as a
  597.   white vertical "stripe" in the box.
  598.  
  599.   To set attributes, right mouse click the first
  600.   tile that you wish to set.  Drag the mouse to
  601.   highlight the desired row/column or rectangle of
  602.   tiles.  Let go of the mouse button and the
  603.   "Attributes Dialog Box" will appear.  Click on
  604.   the radio buttons for the bits that you wish to
  605.   change.  Click on the "Accept" button to apply
  606.   the new settings to the entire selected range,
  607.   or the "Cancel" button to leave as is.
  608.  
  609.   The settings from one tile can be copied to
  610.   an entire range by selecting that tile first,
  611.   then dragging the mouse to select the range.
  612.   The attributes dialog box displays the settings
  613.   for the first tile selected, which can then be
  614.   applied to the entire range by choosing "Accept".
  615.  
  616.  
  617. WORKING WITH HIGH OR LOW DRESSINGS:
  618.  
  619.   Click on the pusbutton marked "High" or "Low" to
  620.   place or delete High or Low dressings.  High
  621.   dressings are drawn over top of other map elements
  622.   to fully or partially "hide" the elements "below".
  623.   Low dressings  are drawn over tiles, but under
  624.   Anims and High dressings.  The following sections
  625.   applies to both High and Low dressings.
  626.  
  627.  Selecting Dressings:
  628.  
  629.   Dressings are selected from the current dressings
  630.   group (or range) shown across the bottom of the
  631.   menu.
  632.  
  633.   Select the dressing that you wish to place on the
  634.   map by:
  635.  
  636.    * clicking on one of dressings visible on the menu
  637.  
  638.    * pressing the function key specified below the
  639.      dressing on the menu
  640.  
  641.   Random Dressing Selection:
  642.  
  643.   Click on the "Random" pushbutton to have dressings
  644.   selected randomly from the current group.  The
  645.   words "Random On" will appear in the status window
  646.   on the lower right of the menu.
  647.  
  648.   Determining The Number of Dressings On the Map:
  649.  
  650.   Each time that you select a dressing, the number of
  651.   this particular dressing currently on the map is
  652.   displayed over the selected dressing on the menu.
  653.  
  654.  Selecting Dressing Groups:
  655.  
  656.   Select a tile group (or range) by clicking on the
  657.   "Next" or "Back" pushbuttons.
  658.  
  659.   Dressing groups are simply a group of 9 bitmaps
  660.   ( the maximum number that can be displayed
  661.   across the menu).
  662.  
  663.   Defining Dressing Groups:
  664.  
  665.   Dressing groups are defined by the order in which
  666.   they were specified when the bitmap "Lib" file was
  667.   created using the MakeLib.exe utility.
  668.  
  669.  Placing Dressings On The Map:
  670.  
  671.   To place the selected dressing on the map, simply
  672.   move the mouse pointer to the desired location and
  673.   click the left mouse button.
  674.  
  675.   If the random feature is turned on, each time you
  676.   click the mouse, a dressing will be randomly
  677.   selected from the current tile group.
  678.  
  679.  Deleting Dressings From The Map:
  680.  
  681.   To delete a dressing from the map, choose place
  682.   "HiDress" (for example).  Now click on the "Delete"
  683.   button.  The word Delete will flash on the menu.
  684.  
  685.   Move the mouse pointer over the dressing that you
  686.   wish to delete (on the map).  Notice that as you
  687.   move the pointer over each of the high dressings
  688.   (or low dressings if you have chosen them), the
  689.   menu displays the number of dressings of this type
  690.   currently on the map.  Click the left mouse
  691.   button to delete the dressing.
  692.  
  693.   Selecting a dressing on the menu when in "delete"
  694.   mode will display the number of that type of
  695.   dressing on the map.
  696.  
  697.  Setting Dressing Attributes:
  698.  
  699.   When in "placing Low dressings or High dressings
  700.   mode", click on the "Attrib" pushbutton.  The
  701.   attribute byte for each dressing will now be
  702.   displayed at the upper left corner of each
  703.   dressing bitmap (note that this may appear to be
  704.   "off" the dressing if it is not rectangular).
  705.  
  706.   Click the right mouse button on the desired
  707.   dressing and release to change attributes in
  708.   much the same way as for tiles (see Setting Tile
  709.   Attributes - above ), except it is done one
  710.   object at a time.
  711.  
  712. WORKING WITH ANIMS:
  713.  
  714.   Working with anims is virtually identical to
  715.   working with high or low dressings, except
  716.   that when you place an anim onto the map, it
  717.   begins it's internal animation cycling.
  718.  
  719.   You can adjust the settings for the anims by
  720.   using the "EditSpr.exe" visual utility on the
  721.   individual sprite files before combining them
  722.   into the anim library file.
  723.  
  724.  
  725. =============== EDIT TILE LIB HELP FILE =============
  726.  
  727. --------------- SETTING TILE GROUPS -----------------  
  728.  
  729. To set tile groups to be used in editing tile maps:  
  730.  
  731.   *  Click on "Next", "Back" pushbuttons to  select 
  732.      tile groups that you wish to set.
  733.  
  734.   *  Click on the "First", "Last" input boxes and 
  735.      type in the index of the start, end tiles for 
  736.      each group.
  737.  
  738.  
  739. ------------------- MOVING TILES --------------------
  740.  
  741. To exchange tiles: 
  742.    
  743.   *  Click left mouse button on first tile, 
  744.      drag to new location and release mouse button.
  745.  
  746.      The first tile will be exchanged with the tile 
  747.      at the location where you released the button.
  748.  
  749.  
  750.  
  751. -----------------------------------------------------
  752.  
  753. =============== EDIT SPRITE HELP FILE ===============
  754.  
  755.                      editspr.exe
  756.  
  757. --------------------- MAIN MENU ---------------------
  758.  
  759.  
  760. The main menu gives you access to the following
  761. editing submenus (bottom row):
  762.  
  763.  "O=centrOffset C=Cycle B=collideBox A=Attach"
  764.  
  765.  
  766.   O=centrOffset:  adjust the sprite x, y offsets to
  767.                   "centre" the sprite for each
  768.                   frame of animation.
  769.  
  770.   C=Cycle:        cycle the sprite through it's
  771.                   internal animation, set the speed
  772.                   of animation.
  773.  
  774.   B=collideBox:   adjust the collision rectangle
  775.                   for each frame to provide more
  776.                   accurate and realistic collision
  777.                   detection.
  778.  
  779.   A=Attach:       set from 1 to 4 "attach" points
  780.                   for each frame of animation
  781.                   (Ex: set attach point #1 to be at
  782.                    the gun barrel of a rotating
  783.                    tank).
  784.  
  785. In addition the following functions are available:
  786.  
  787.  "MAIN MENU    T=Toggle bitmaps  W=Write file"
  788.  
  789.   T=Toggle bitmaps:
  790.  
  791.     Toggle between the primary bitmaps and the
  792.     clipping (.PBM) bitmaps if the sprite file
  793.     contains both.
  794.  
  795.     Clipping bitmaps may be included if the primary
  796.     bitmaps are of a non-clipping type such as
  797.     packed (.PKB) bitmaps.  The animation engine
  798.     will automatically switch to the .PBM and clip
  799.     if the sprite is at one edge of it's clip
  800.     rectangle.
  801.  
  802.  
  803.  
  804.   W=Write file: Press 'W' to save changes to disk.
  805.  
  806.  
  807.  
  808. --------------- OFFSET CENTER MENU ------------------
  809.  
  810.  
  811. This function is used to center each frame of the
  812. sprite animation.
  813.  
  814.  
  815. The intersection of the vertical and horizontal lines
  816. indicates the center of all frames.
  817.  
  818. SPACE BAR:     step through each frame of animation.
  819.  
  820. LEFT, RIGHT ARROW keys: move each bitmap horizontally
  821.                         to center with the crosshair.
  822.  
  823. UP, DOWN ARROW keys:    move each bitmap vertically
  824.                         to center with the crosshair.
  825.  
  826. ESC = exit to main menu
  827.  
  828.  
  829. ------------------ CYCLE  MENU ----------------------
  830.  
  831.  
  832. This function is used to cycle the sprite through
  833. it's bitmaps in order to set the default speed of
  834. animation.
  835.  
  836. 'C'  : cycle Continuously
  837.  
  838. 'O'  : cycle Once
  839.  
  840. 'F'  : Faster cycling
  841.  
  842. 'S'  : Slower cycling
  843.  
  844. SPACE BAR:  stop cycling
  845.  
  846. ESC:  exit to main menu
  847.  
  848.  
  849. ------------- COLLISION RECTANGLE MENU --------------
  850.  
  851. This function is used to set the collision rectangle
  852. for each frame of animation in order to get a more
  853. accurate and realistic collision zone.
  854.  
  855.  
  856. SPACE BAR:       step through each frame of animation
  857.  
  858. ARROW KEYS:      move collision rectangle
  859.  
  860. CTRL+ARROW KEYS: size collision rectangle
  861.  
  862. ESC = exit to main menu
  863.  
  864.  
  865. ---------------- ATTACH POINTS MENU -----------------
  866.  
  867. This function is used to set the attach points (1to4)
  868. for each frame of animation. They provide an x, y
  869. offset from the sprite's position for launching
  870. bullets, etc.
  871.  
  872.  
  873. '1'  :   go to Attach point #1 menu
  874. '2'  :   go to Attach point #2 menu
  875. '3'  :   go to Attach point #3 menu
  876. '4'  :   go to Attach point #4 menu
  877.  
  878. ESC = exit to main menu
  879.  
  880.  
  881. ------------ ATTACH POINT#1(,2,3,4) MENU ------------
  882.  
  883. This function is used to set the location (with
  884. respect to the sprite) of attach point#1(,2,3,4)
  885. for each frame of animation.
  886.  
  887. SPACE BAR:       step through each frame of animation
  888.  
  889. ARROW KEYS:      move attach point (short cross-hair)
  890.  
  891. ESC = exit to main menu
  892.  
  893.  
  894. ===================================
  895.  
  896.  
  897. CPUID.EXE
  898.  
  899. cpuid.exe was compiled and linked on a XT to provide maximum
  900. compatibility with older computers.
  901.  
  902. CPUID has been tested on an XT(8086) and a 486 so far.
  903. CPUID sets the dos errorlevel on exit to match to processor level
  904. for use in batch files.
  905.  
  906. 0 for 8086
  907. 1 for 186
  908. 2 for 286
  909. 3 for 386
  910. 4 for 486
  911. 5 for 586 (Pentium)
  912. etc...
  913.  
  914. It also checks for a Co-Pro, but that value is not returned.
  915.  
  916.  
  917. ----------------------------------------------------------------
  918.  
  919.  
  920. // -------- Where to find info in H files
  921.  
  922. Basic defines (e.g. USHORT)             G_DEF.H
  923.  
  924. DEBUG
  925.  
  926.  print to MDA (second monitor)          PR2.H
  927.  die / exit funcs                       DIE.H
  928.  
  929.         Hot keys
  930.         CTRL-ALT-DEL                    Exit to Dos, do all die funcs
  931.         CTRL-ALT-E                      list all exit func
  932.         CTRL-ALT-H                      heap walk
  933.         CTRL-ALT-L                      gmalloc list/mem overwrite
  934.                                           check
  935.         CTRL-ALT-V                      List events in queue
  936.                                           (not terribly useful)
  937.         CTRL-ALT-P                      Pause
  938.  
  939. Demo Scripts                            DSPRC.H
  940. Erase rects                             ERASE.H
  941.  
  942. Gmalloc  memory allocation+             GMALLOC.H
  943. Quick malloc                            QMALLOC.H
  944.         Used by the erase rect code
  945.  
  946. Init xmode, restore prev mode           PALETTE.H
  947.  
  948. Input / Output
  949.         keyboard/joystick/mouse         G_IO.H
  950.         gui basic stuff                 GUI.H
  951.         gui tools                       GUITOOL?.H
  952.  
  953. Lines Arbitrary in C                    LINE.H
  954.  
  955. Palette loading, cycling, init xmode    PALETTE.H 
  956.         
  957. XMS                                     XMEM.H        
  958.  
  959. Every H file ---------------------------------------------------
  960.  
  961. BLIT13   H      Yup, some mode 13 code.
  962. COLORS   H      EGA colour defines.
  963. DANM     H      Mode13 fullscreen anims using frame-diff coding.
  964. DEMO     H      Just for the demo.
  965. DIE      H      Improved on exit functions.
  966. DSPRC    H      Demo scripts stuff.
  967. ERASE    H      Auto erase rects for page flipping code.
  968. FSTRING  H      Before Borland 3.1 used these.
  969. G_DEF    H      USHORT BYTE and other defines.
  970. G_IO     H      Keyboard/joystick/mouse i/o.
  971. GMALLOC  H      Fancy malloc with node names, sizes, and mem
  972.                   overwrite checking.
  973. GSOUND   H      Lame sound, really just a place holder.
  974. GTIMER   H      Speed up the timer etc...
  975. GUI      H      All the main GUI stuff.
  976. LINE     H      C arbitrary lines, frame by frame - used to move
  977.                 objects along straight lines.
  978. PALETTE  H      Palette stuff, and init xmode.
  979. POLYGON  H      Polygon stuff - not easy to use, but FAST.
  980. PR2      H      Output like printf() to an MDA.
  981. QMALLOC  H      Used to quickly allocate mem from a pool. Much FASTER
  982.                   than malloc, but can't free individual items.
  983. READG    H      Read a file buffered from XMS if inited, else from
  984.                   disk.
  985. READLBM  H      Read a Dpaint TM LBM file and convert to linear bitmap.
  986. SPRFILE  H      Animation engine.
  987. SPRBANK  H      Animation engine.
  988. SPRITE   H      Animation engine.
  989. XMEM     H      Easy to use XMS stuff.
  990. XPACKBM  H      Our RLE planar bitmaps - faster than normal masked
  991.                   bitmaps.
  992. XSCALE   H      Scale Linear bitmaps and display in xmode - FAST.
  993.  
  994.  
  995. All these are the original XLIB includes for all your basic drawing
  996. functions.
  997.  
  998. XBEZIER  H      Bezier curves - I never used them, but you might.
  999. XBMTOOLS H      Make PBM,CBM etc... Our make???.EXE utils use this.
  1000. XCBITMAP H      Compiled bitmaps.
  1001. XCIRCLE  H      circles!
  1002. XCLIPPBM H      Clipped PBM's
  1003. XCOMPPBM H      make cbm's
  1004. XDETECT  H      detect mouse, video card, CPU
  1005. XFILEIO  H      file io, doesn't use fopen()
  1006. XLINE    H      draw lines
  1007. XPAL     H      Use the code in palette.h - its faster
  1008. XPBITMAP H      PBM drawing
  1009. XPBMCLIP H      more clipped PBm's
  1010. XPOINT   H      draw a pixel, get a pixel
  1011. XRLETOOL H      a generic RLE func
  1012. XVBITMAP H      hybrid sprites half in vid mem/half in conv mem
  1013. XMOUSE   H      Use G_IO.H and GUI.H instead
  1014. XLIB     H      xlib defines, and startup code, use the init_xmode in
  1015.                 palette.h NOT xlib.h
  1016. XLIB_ALL H      Includes all the xlib includes
  1017. XTEXT    H      Fast easy text
  1018. XRECT    H      fast filled and patterned rectangles
  1019.  
  1020.  
  1021.  
  1022. ------------------ source examples -----------------------------------
  1023.  
  1024.  
  1025. /*
  1026.  
  1027.  
  1028.  Example of Include files, and stuff you just have to have in every program
  1029.  
  1030.     testa.c
  1031.  
  1032.     Internet: alexad3@icebox.iceonline.com
  1033.     Copyright 1995, April 14 by Alec Russell, ALL rights reserved
  1034.  
  1035.     Created - 1995/4/14
  1036.  
  1037.     A silly little demo of basic GameSmith stuff
  1038.  
  1039.     History:
  1040.         New file
  1041.  
  1042. */
  1043.  
  1044. #include <stdio.h>
  1045.  
  1046. #include <pr2.h>     // for debug display
  1047. #include <g_def.h>   // standard types eg ULONG, BYTE, USHORT
  1048. #include <palette.h>  // palette loading, init xmode
  1049. #include <g_io.h>    // i/o
  1050. #include <gui.h>     // if you use the gui you need this
  1051. #include <erase.h>   // for erase rects
  1052. #include <die.h>     // clean death code
  1053. #include <gmalloc.h> // if you gmalloc any mem
  1054. #include <gtimer.h>  // speed up timer for smoother animation
  1055.  
  1056. #include <Xlib_all.h> // all basic drawing functions
  1057.  
  1058.  
  1059. /* ---------------------- main() ------------------------- April 28,1993 */
  1060. void main(void)
  1061. {
  1062.    short done;
  1063.  
  1064.    clear_pr2();         // clear MDA screen for debug out-put
  1065.  
  1066.    init_exit();         // init all die related code, MUST be first!
  1067.    init_mem_list();     // neccessary or will crash!!!! MUST be next
  1068.    init_xmode_video();  // enter xmode, MUST precede init_events()
  1069.                         // 360x320 256 color, page-flipping enabled
  1070.    init_timer();        // speed up timer, required for fades
  1071.  
  1072.    /* set palette - highly reccomended to load your own palette */
  1073. pr2("loading palette"); // pr2() prints to a MDA - just like printf()
  1074.    if ( load_palette("small.pal", palette) ) // this doesn't set it
  1075.       die("error getting palette");
  1076.       // don't use exit - use die()! It automaticly
  1077.       // cleans up, restores ISR's, and previous vid mode.
  1078.    setvgapalette(palette);
  1079.  
  1080.    pr2("init events and load mouse");
  1081.    /* intit all i/o code, install keyboard handler, auto-calibrate
  1082.       joystick, loads mouse pointer bitmap also 
  1083.       the mouse pointer MUST be a cbm type bitmap
  1084.    */
  1085.    init_events("crshair.cbm");  // this must be AFTER init_xmode_video()
  1086.  
  1087.    // REQUIRED - mouse drawing code requires this even if you
  1088.    // don't call add_erase_rect()
  1089.    /* set aside mem etc.. for 4 erase rects, not to exceed 2k */
  1090.    init_gb_erase(4, 2000);
  1091.  
  1092.    page=0; // I'm just paranoid
  1093.    done=0;
  1094.  
  1095.    while ( !done )
  1096.       {
  1097.       /* erase old stuff */
  1098.       draw_erase_rects(&(gb_h[page]));
  1099.  
  1100.  
  1101.       /* draw your stuff here */
  1102.       /* handle gui stuff here */
  1103.       /* yup, this where all your very own cool code goes! */
  1104.  
  1105.  
  1106.       /* draw the mouse - always the last thing drawn */
  1107.       gui_draw_mouse();
  1108.  
  1109.       x_page_flip(PhysScrnXOffs, PhysScrnYOffs);
  1110.       page= page ? 0 : 1;
  1111.       }
  1112.  
  1113.    deinit_timer();
  1114.    deinit_gb_erase(); // free up the mem in use
  1115.    deinit_events();   // restore normal keyboard handler (BIOS)
  1116.    deinit_xmode_video(); //  return to previos video/text mode
  1117. }
  1118.  
  1119. // so just copy the above into your own file and go for it.
  1120.  
  1121.  
  1122. **********************************************************************
  1123. **********************************************************************
  1124.  
  1125.  
  1126. /*
  1127.  
  1128.    Example of using the GUI
  1129.  
  1130.    Copyright 1993, Alec Russell, ALL rights reserved
  1131.  
  1132.    FILE : gui_test.c
  1133.  
  1134.           graphic gui-editor panel tester
  1135.  
  1136.          Also a good example of using the gui and lib
  1137.  
  1138.    HISTORY:
  1139.       created :  june 4, 1993
  1140.       updates :
  1141.  
  1142. */
  1143.  
  1144. #include <stdio.h>
  1145. #include <alloc.h>
  1146. #include <string.h>
  1147.  
  1148. #include <g_def.h>
  1149. #include <gui.h>
  1150. #include <g_io.h>
  1151. #include <palette.h>
  1152. #include <erase.h>
  1153. #include <gsound.h>
  1154.  
  1155. #include <xlib_all.h>
  1156.  
  1157. char gui_path[128];
  1158.  
  1159. // add the gui_path to a file name
  1160. /* ---------------------- get_gui_path() -------------- February 21,1994 */
  1161. char *get_gui_path(char *f)
  1162. {
  1163.    static char gui_p[128];
  1164.  
  1165.    strcpy(gui_p, gui_path);
  1166.    strcat(gui_p, f);
  1167.  
  1168. pr2("load gui_p = %s", gui_p);
  1169.  
  1170.    return(gui_p);
  1171. }
  1172.  
  1173. // get the directory the exe was run from
  1174. /* ---------------------- set_gui_path() -------------- February 21,1994 */
  1175. void set_gui_path(char *p)
  1176. {
  1177.    strcpy(gui_path, p);
  1178.    p=gui_path;
  1179.    while ( *p++ )
  1180.       ;
  1181.  
  1182.    while ( *p != '\\' )
  1183.       p--;
  1184.  
  1185.    p++;
  1186.    *p=0;
  1187.  
  1188. pr2("ORG gui path = %s", gui_path);
  1189. }
  1190.  
  1191.  
  1192. /* ---------------------- main() --------------------------- May 25,1993 */
  1193. void main(int argc, char *argv[])
  1194. {
  1195.    short done=0, i;
  1196.    event_t event;
  1197.  
  1198.    clear_pr2();
  1199.    pr2("at the top");
  1200.  
  1201.    printf("GUI_TEST - v1.0 Copyright 1993 Alec Russell, all rights reserved\n");
  1202.    printf("Press a key\n");
  1203.    getch();
  1204.  
  1205.    if ( argc < 2 )
  1206.       {
  1207.       printf("USE - gui_test guifile<ENTER>\n");
  1208.       exit(1);
  1209.       }
  1210.  
  1211.    init_mem_list();  // this has to be done or gmalloc crashes
  1212.  
  1213.    set_gui_path(argv[0]);
  1214.  
  1215.    // load the gadget, and make current
  1216.    pr2("load gadget...");
  1217.    if ( gui_load_gadget(argv[1], gui_path) )
  1218.       {
  1219.       printf("ERROR loading: %s\n", argv[1]);
  1220.       exit(1);
  1221.       }
  1222.  
  1223.    // look for lists, and init them
  1224.    for ( i=1; i < gui_list.num_gadgets; i++ )
  1225.       {
  1226.       if ( ((gui_rect_t *)gui_list.gadget[i])->type == GUI_PLIST )
  1227.          {
  1228.          pr2("init plist at %d", i);
  1229.          gui_init_plist_file(((gui_plist_t *)gui_list.gadget[i]),
  1230.             get_gui_path("list.txt"));
  1231.          }
  1232.       }
  1233.  
  1234.    init_xmode_video();
  1235.  
  1236.  
  1237.    // the mouse pointer MUST be a CBM
  1238.    init_events(get_gui_path("crshair.cbm"));
  1239.  
  1240.    load_palette(get_gui_path("std.pal"), palette);
  1241.    setvgapalette(palette);
  1242.  
  1243.    // make sure this is AT LEAST large enough for the mouse pointer!
  1244.    /* set aside mem etc.. for 4 erase rects, not to exceed 16k */
  1245.    init_gb_erase(4, 16000); // 16k is overkill in this case
  1246.  
  1247.    page=0;
  1248.  
  1249.    while ( !done )
  1250.       {
  1251.       /* erase old stuff */
  1252.       draw_erase_rects(&(gb_h[page]));
  1253.  
  1254.       // you could add code here to have stuff happening UNDER the
  1255.       // gui
  1256.  
  1257.       event.d2=0;
  1258.       if ( gui_do_gadget(&event) ) // this re-draws the gui as well
  1259.          {
  1260.          switch ( event.type )
  1261.             {
  1262.             case E_GUI:
  1263.                pr2("gui id = %d curr_gadget = %d d2 = %d", event.d1, gui_list.num, event.d2);
  1264.                break;
  1265.  
  1266.             case E_KEY:
  1267.                if ( event.d2 == ESC )
  1268.                   done=1;
  1269.                break;
  1270.  
  1271.             }
  1272.          }
  1273.  
  1274.       // you could add stuff here to draw OVER the gui
  1275.  
  1276.       /* draw the mouse - does erase rect stuff automaticly */
  1277.       gui_draw_mouse();
  1278.  
  1279.       /* page flip */
  1280.       x_page_flip(PhysScrnXOffs, PhysScrnYOffs);
  1281.       page= page ? 0 : 1;  // page is used by the erase rect code
  1282.       }
  1283.  
  1284.    gui_unload_gadget(); // free up mem
  1285.    deinit_events();
  1286.    deinit_gb_erase(); // free up the mem in use
  1287.    deinit_xmode_video(); // restore previous vid mode
  1288.  
  1289. }
  1290.  
  1291.  
  1292. /* ------------------------------ EOF -------------------------------- */
  1293.  
  1294.  
  1295.